import {getQuestionHandleList,getChecked,getCheck,getQuality,getQualit,getAnswer} from "@/services"
import {makeAutoObservable} from "mobx"
import { message} from 'antd';
// import {  ISkillLabel ,IinterviewManageTableItem} from "@/utils/interface"
import {IQuestionHandleQuery, IswapParams} from "@/utils/interface"

class QuestionHandle{
    constructor(){
        makeAutoObservable(this)
    }

    //定义仓库中的属性
    QuestionHandleList=[]
    AnswerList=[]


    //定义仓库中的方法
    async getQuestionHandleList(params:IQuestionHandleQuery){
        let result =await getQuestionHandleList(params)
        // console.log(result,'redult');
        
        if(result.rows){
            this.QuestionHandleList=result.rows
        }
        // console.log(111,this.QuestionHandleList);
        
    }
    async getChecked(value:string){
        let result = await getChecked(value)
        // console.log(result);
        message.error('取消屏蔽成功')
    }
    async getCheck(value:string){
        let result = await getCheck(value)
        // console.log(result);
        message.success('屏蔽成功')
    }

    //取消精品
    async getQuality(value:string){
        let result = await getQuality(value)
        message.error('取消精品')
    }
    //设为精品
    async getQualit(value:string){
        let result = await getQualit(value)
        // console.log(result);
        message.success('设为精品')
    }

    //弹框数据
    async getAnswer(params:IswapParams){
        let result =await getAnswer(params)
        // console.log(result,'result');
        if(result.rows){
            this.AnswerList=result.rows
            
        }
        // console.log(this.AnswerList);
        
    }
}

export default new QuestionHandle